from . import flutter

TextStyle = flutter.TextStyle
Container = flutter.Container
Center = flutter.Center
Text = flutter.Text
Stack = flutter.Stack
Row = flutter.Row
Positioned = flutter.Positioned
Transform = flutter.Transform
LinearGradient = flutter.LinearGradient
Colors = flutter.Colors
TextAlign = flutter.TextAlign
EdgeInsets = flutter.EdgeInsets
FontWeight = flutter.FontWeight
FontStyle = flutter.FontStyle
BoxShadow = flutter.BoxShadow
BoxShape = flutter.BoxShape
RichText = flutter.RichText
TextSpan = flutter.TextSpan
TextOverflow = flutter.TextOverflow
BorderRadius = flutter.BorderRadius
Offset = flutter.Offset
Scaffold = flutter.Scaffold
AppBar = flutter.AppBar
IconButton = flutter.IconButton
Icon = flutter.Icon
Icons = flutter.Icons
MaterialBanner = flutter.MaterialBanner
# CircleAvatar = flutter.CircleAvatar
FlatButton = flutter.FlatButton
TextButton = flutter.TextButton
OutlinedButton = flutter.OutlinedButton
ContainedButton = flutter.ContainedButton
Column = flutter.Column
Card = flutter.Card
ListTile = flutter.ListTile
ButtonBar = flutter.ButtonBar
FlatButton = flutter.FlatButton
MainAxisAlignment = flutter.MainAxisAlignment
ListView = flutter.ListView
PopupMenuButton = flutter.PopupMenuButton
# PopupMenuEntry = flutter.PopupMenuEntry
# BuildContext = flutter.BuildContext
PopupMenuItem = flutter.PopupMenuItem
PopupMenuDivider = flutter.PopupMenuDivider
PaginatedDataTable = flutter.PaginatedDataTable
CheckBox = flutter.CheckBox
DisabledCheckBox = flutter.DisabledCheckBox
ChoiceChip = flutter.ChoiceChip
RadioButton = flutter.RadioButton
Chip = flutter.Chip
TabButton = flutter.TabButton
TabBar = flutter.TabBar
DataTable = flutter.DataTable
AlertDialog = flutter.AlertDialog
Button = flutter.Button
Children = flutter.Children
Switch = flutter.Switch

def test():
    return Scaffold(
        appBar=AppBar(
            title=Text('Lists'),
            leading=Icon(Icons.arrow_back, href="http://localhost:8000/web/_main_.html"),
            actions=[
                Icon(Icons.refresh, href='lists.html'),
            ],
        ),

        body=Children(
            children=[
                ListView(
                    # single-line list
                    children=[
                        ListTile(
                            title=Text('Cellular Data'),
                            trailing=Switch(
                                value=False,
                                activeColor=Colors.argb('FF6200EE'),
                                onChanged=True,
                                id='switch-1',
                            ),
                            color='black'
                        ),
                        PopupMenuDivider(),
                        ListTile(
                            title=Text('Wi-Fi'),
                            trailing=Switch(
                                value=True,
                                activeColor=Colors.argb('FF6200EE'),
                                onChanged=True,
                                id='switch-1',
                            ),
                            color='black'
                        ),
                        PopupMenuDivider(),
                        ListTile(
                            title=Text('Allow notifications'),
                            trailing=RadioButton(
                                id='R1',
                                name=Text('')
                            ),
                            margin='-4.5px',
                            color='black'
                        ),
                        PopupMenuDivider(),
                        ListTile(
                            title=Text('Turn off notifications'),
                            trailing=RadioButton(
                                id='R1',
                                name=Text('')
                            ),
                            margin='-4.5px',
                            color='black'
                        ),
                        PopupMenuDivider(),
                        ListTile(
                            title=Text('Microphone access'),
                            trailing=CheckBox(
                                onChanged=True,
                                tristate=False,
                                value=True,
                                activeColor=Colors.argb("FF6200EE"),
                                id=f'checkbox-1'
                            ),
                            color='black'
                        ),
                        PopupMenuDivider(),
                        ListTile(
                            title=Text('Location access'),
                            trailing=CheckBox(
                                onChanged=True,
                                tristate=False,
                                value=True,
                                activeColor=Colors.argb("FF6200EE"),
                                id=f'checkbox-1'
                            ),
                            color='black'
                        ),
                        PopupMenuDivider(),
                        ListTile(
                            title=Text('Haptics'),
                            trailing=CheckBox(
                                onChanged=True,
                                tristate=False,
                                value=False,
                                activeColor=Colors.argb("FF6200EE"),
                                id=f'checkbox-1'
                            ),
                            color='black'
                        ),
                    ],
                ),
            ]
        ),
    )

def run_app():
    test_ = test()
    javascript.document.body.appendChild(test_.render())

run_app()

